package moni.anyou.com.view.view;

import java.util.LinkedList;
import java.util.List;
import android.app.Activity;
import android.app.Application;
public class LogOut extends Application {
	public static LogOut instance;
	private List<Activity> activityList=new LinkedList<Activity>();

	public LogOut() {

	}

	public static LogOut getInstance() {
		if (null == instance) {
			instance = new LogOut();
		}
		return instance;

	}
	public void addActivity(Activity activity)
	{
	    activityList.add(activity);
	 }
	public boolean checkIsExit(Activity activity)
	{
		 boolean isExit = false;
	     for(Activity temp:activityList)
		 {
	    	 if (temp.equals(activity)){
	    		 isExit = true;
	    		 break;
	    	 }
		    
		 }
		 return isExit;
		 
	 }
	//Activity finish
	
	 public void exit()
	 {
	
	 for(Activity activity:activityList)
	 {
	 activity.finish();
	 }
	
	 System.exit(0);
	
	 }
	

}
